A “stack buffer overflow” or “stack buffer overrun” occurs when a program writes to a memory address on the program's subroutine or call stack outside of the intended memory area, which is usually a fixed-length buffer. The stack buffer overflow bug occurs when a program writes more data than is allocated to a buffer located on the stack. This almost always results in corruption of adjacent data on the stack, and in cases where the overflow was triggered by mistake, will often cause the program to crash or operate incorrectly. Stack buffer overflow is a type of a more general programming malfunction known as buffer overflow (or buffer overrun). Overfilling a buffer on the stack is more likely to derail program execution than overfilling a buffer on the heap because the stack often contains the return addresses for all active function calls.